Learn R Programming

aqp (version 1.25)

[,SoilProfileCollection-method: Matrix/data.frame-like access to profiles and horizons in a SoilProfileCollection

Description

You can access the contents of a SoilProfileCollection by profile and horizon "index", i and j, repectively: spc[i, j]. Subsetting operations are propagated to other slots when they result in removal of sites from a collection.

i refers to the profile position within the collection. By default the order is based on the C SORT order of the variable that you specified as your unique profile ID at time of object construction. Note that if your ID variable was numeric, then it has been sorted as a character.

j refers to the horizon or "slice" index. This index is most useful when either a) working with slice'd SoilProfileCollection or b) working with single-profile collections. j returns the layer in the specified index positions for all profiles in a collection. So, for instance, if spc contained 100 profiles, spc[,2] would return 100 profiles, but just the second horizon from each of the profiles ... assuming each profile had at least two horizons! The single horizon profiles would be dropped from the collection.

Usage

# S4 method for SoilProfileCollection
[(x, i, j)

Arguments

x

a SoilProfileCollection

i

a numeric or logical value denoting profile indices to select in a subset

j

a numeric or logical value denoting profile indices to select in a subset